
// 实现可迭代接口（Iterable）
let obj = {
  store: ['foo', 'bar', 'www'],
  [Symbol.iterator]: function() {
    let self = this
    let index = 0
    return {
      next: function () {
        let result = {
          value: self.store[index],
          done: index >= self.store.length
        }
        index++
        return result
      }
    }
  }
} 